from django.urls import path
from django.conf.urls.static import static
from django.conf import settings
from web.api.translate import line1 as api_translate_line1
from web.api.ocr import line1 as api_ocr_line1
from web.views import home
urlpatterns = [
    # api
    path("api/translate/line1/translate/", api_translate_line1.translate), # 翻译
    path("api/translate/line1/sug/", api_translate_line1.sug), # 获取翻译建议
    path("api/translate/line1/identify_language/", api_translate_line1.identify_language), # 识别语言

    # ocr
    path("api/ocr/line1/start_dialogue/", api_ocr_line1.start_dialogue), # 开始对话
    path("api/ocr/line1/create_dialogue/", api_ocr_line1.create_dialogue), # 创建模型id

    # 前端
    path("", home.index), # 首页
    path("web/home/index/", home.index), # 首页
    path("web/home/ordinary/ordinary_translate/", home.ordinary_translate), # 普通翻译
    path("web/home/image_to_text/", home.image_to_text), # 图片转文本
]
# 添加媒体文件URL配置
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)